﻿package cgs.server.logging.requests
{
    import cgs.server.logging.messages.*;

    public class QuestRequest extends CallbackRequest
    {
        private var _questMessage:IQuestMessage;
        private var _questGameID:int = 0;
        private var _requestCallback:Function;

        public function QuestRequest(param1:Function, param2:IQuestMessage, param3:Function, param4:int = 0)
        {
            super(param1);
            this._questMessage = param2;
            this._requestCallback = param3;
            this._questGameID = param4;
            return;
        }// end function

        public function get requestCallback() : Function
        {
            return this._requestCallback;
        }// end function

        public function setDQID(param1:String) : void
        {
            if (this._questMessage != null)
            {
                this._questMessage.setDQID(param1);
            }
            return;
        }// end function

        public function getDQID() : String
        {
            return this._questMessage != null ? (this._questMessage.dqid) : (null);
        }// end function

        public function get questMessage() : IQuestMessage
        {
            return this._questMessage;
        }// end function

        public function get questMessageObject() : Object
        {
            this._questMessage.injectParams();
            if (this._questGameID > 0)
            {
                this._questMessage.addProperty("g_s_id", this._questGameID);
            }
            return this._questMessage.messageObject;
        }// end function

    }
}
